<template>
  <div class="">
    <van-nav-bar
      title="砍价列表"
      left-text=""
      left-arrow
      @click-left="$router.go(-1)"
    />
    <CommodityCard
      v-for="(v, i) in obj.bargainList"
      :key="i"
      :cardList="v"
      @click="$router.push('/details?id=' + v.id)"
    ></CommodityCard>
  </div>
</template>

<script>
import { getCardList } from "@/api";
import { ref, reactive } from "vue";
import  CommodityCard  from "@/components/CommodityCard";
export default {
  setup(props) {
    const obj = reactive({
      bargainList: {},
    });
    getCardList().then((result) => {
      obj.bargainList = result.goodsMap;
      console.log(result.goodsMap);
    });
    return {
      obj,
    };
  },
  components: {
    CommodityCard,
  },
};
</script>

<style lang="scss"></style>
